Andy McFadden's CD-Recordable FAQ - Section 2

Last-modified: 1997/09/14
Version: 1.11

[2] CD Encoding
[2-1] How is the information physically stored?
[2-2] What is XA? CDPLUS? CD-i? MODE1 vs MODE2? Red/yellow/blue book?
[2-3] How do I know what format a disc is in?
[2-4] How does CDROM copy protection work?
[2-5] What's a multisession disc?
[2-6] What are subcode channels?
[2-7] Are the CD Identifier fields widely used?
[2-8] How long does it take to burn a CD-R?
[2-9] What's the difference between disc-at-once and track-at-once?
[2-10] Differences between recording from an image and on-the-fly?
[2-11] How does an audio CD player know to skip data tracks?
[2-12] How does CD-E/CD-RW compare to CD-R?
[2-13] Can DVD drives read CD-Rs?
[2-14] Should I wait for DVD-R?
[2-15] What are "jitter" and "jitter correction"?
[2-16] Where can I learn more about the history of CD and CD-R?


Subject: [2] CD Encoding

CD fundamentals.

Subject: [2-1] How is the information physically stored?

From The Compact Disc Handbook, 2nd edition by Ken Pohlmann, 1992 (ISBN 0-89579-300-8):

"Write-once media is manufactured similarly to conventional playback-only discs. As with regular CDs, they employ a polycarbonate substrate, a reflective layer, and a protective top layer. Sandwiched between the substrate and reflective layer, however, is a recording layer composed of an organic dye. .... Unlike regular CDs, a pre-grooved spiral track is used to guide the recording laser along the spiral track; this greatly simplifies recorder hardware design and ensures disc compatibility."

A laser in the CD recorder creates a series of holes in the disc's dye layer called "pits". The spaces between the pits are called "lands". The pattern of pits and lands on the disc encodes the information and allows it to be retrieved on an audio or computer CD player.

The sprial makes 22,188 revolutions around the CD, with roughly 600 track revolutions per millimeter as you move outward. If you "unwound" the spiral, it would be about 3.5 miles long.

See the net references section for pointers to more data (especially http://www.cd-info.com/). http://www.why.net/home/araltd/whatscdr.html has some nice pictures.

Subject: [2-2] What is XA? CDPLUS? CD-i? MODE1 vs MODE2? Red/yellow/blue book?

See the net references section for pointers. The "information" frame in http://www.cdarchive.com/info/default.htm has useful data, as does http://www.cd-info.com/ and the alt.cd-rom FAQ pages. The page http://emf.net/~mal/cdplus.html is dedicated to CD Extra.

A quick summary of standards:

Red Book
physical format for audio CDs (a/k/a CD-DA)
Yellow Book
physical format for data CDs
Green Book
physical format for CD-i
Orange Book
physical format for recordable CDs
Part I
CD-MO (Magneto-Optical)
Part II
CD-WO (Write-Once; includes "hybrid" spec for PhotoCD)
Part III
CD-RW (ReWritable)
White Book
format for VideoCD
Blue Book
CD Extra (occasionally used to refer to LaserDisc format)
CD Extra
a two-session CD, 1st is CD-DA, 2nd is data (a/k/a CD Plus)
CDROM/XA
eXtended Architecture, a bridge between Yellow Book and CD-i
MODE-1
standard Yellow Book sectors
MODE-2
may be of form-1 or form-2
FORM-1
2048 bytes of data, with error correction, for data
FORM-2
2324 bytes of data, no ecc, for audio/video
ISO 9660
file layout standard (formerly called High Sierra)
Rock Ridge
extensions allowing UNIX stuff like long filenames and symlinks
CDR-RFS
Sony's incremental packet-writing filesystem
CDR-UDF
industry-standard incremental packet-writing filesystem
CD-Text
Philips' standard for encoding disc and track data on audio CDs

In case the above seems straightforward, Yellow Book actually defines both mode 1 and mode 2, where mode 2 contains 2336 user data bytes. Green Book defines mode 2 form 1 and form 2. This means that mode 2 sectors may be "formless" and are sometimes called Yellow Book mode 2.

See http://www.cd-info.com/CDIC/Bibliography.html for information on where to get copies of the standards. You can download some of them from http://www.ecma.ch/. ECMA-119 describes ISO-9660, and ECMA-130 sounds a lot like "yellow book" if you say it slowly.

If you're not entirely put off by all this, pay a visit to http://www.onlineinc.com/emedia/AprEM/parker4.html.

Subject: [2-3] How do I know what format a disc is in?

You can usually tell by looking at the packaging and/or the disc itself:

Subject: [2-4] How does CDROM copy protection work?

There are several possibilities; as yet no developers have come forward and announced what they're doing (for obvious reasons).

A simple and commonly seen technique is to increase the length of several files on the CD so that they appear to be hundreds of megabytes long. This is accomplished by setting the file length in the disc image to be much larger than it really is. The file actually overlaps with many other files. So long as the application knows the true file length, the software will work fine. If the user tries to copy the files onto their hard drive, or do a file-by-file disc copy, the attempt will fail because the CD will appear to hold a few GB of data. (In practice this doesn't foil pirates, because they always do image copies.)

One possible implementation, given sufficient control over the reader and mastering software, is to write faulty data into the ECC portion of a data sector. Standard CDROM hardware will automatically correct the "errors", writing a different set of data onto the target disc. The reader then loads the entire sector as raw data, without doing error correction. If it can't find the original uncorrected data, it knows that it's reading a "corrected" duplicate. This is really only viable on systems like the Sony Playstation, where the drive mechanism and firmware are well defined.

A less sophisticated but nontheless effective method is to press a silver CD with data out beyond where a 74-minute CD can write. Copying the disc would then require special CD-R blanks, moving the data and hacking the disc to compensate, or pressing silver discs with the pirated data. If taken too far, though, the disc can become unreadable on some drives.

The approach PC software houses have taken lately is to use nonstandard gaps between audio tracks and leave index marks in unexpected places. These discs are uncopyable by most software, and it may be impossible to duplicate them on drives that don't support disc-at-once recording (see section (2-9)).

A recent innovation is TTR Technology's DiscGuard (http://www.ttr.co.il). They claim to be able to write a signature onto pressed CDs and CD-Rs that is detectable by all CD-ROM drives but isn't reproducible without special hardware. A program could use this for copy protection by checking for the presence of the signature, and refusing to run if it's not there.

Subject: [2-5] What's a multisession disc?

A session is a recorded segment that may contain one or more tracks of any type. The CD recorder doesn't have to write the entire session at once, but the last session on a disc must be "closed" before a standard audio CD or CDROM player will recognize it. Additional sessions can be added until the *disc* is closed or there's no space left.

Multisession writing was first used on PhotoCD discs, to allow additional pictures to be appended. Today it's most often used with "linked" multisession discs, and occasionally for CD-Extra discs. These require a bit more explanation.

When you put a data CD into your CDROM drive, the OS finds the last session on the disc and reads the directory from it. (Well, that's how it's supposed to work. Depending on your operating system and CDROM drive, you may get different results.) If the CD is ISO-9660 format - which it almost certainly is unless it's a Macintosh CD written in HFS - the directory entries can point at any file on the CD, no matter which session it was written in.

Most of the popular CD creation programs allow you to "link" one or more earlier sessions to the session currently being burned. This allows the files from the previous sessions to appear in the last session without taking up any additional space on the CD (except for the directory entry). You can also "remove" or "replace" files, by putting the new version into the last session, and not including a link to the older version.

In contrast, when you put an audio CD into a typical CD player, it only looks at the first session. For this reason, multisession writes don't work for audio CDs, but as it happens this limitation can be turned into an advantage. See section (3-14) for details. This limitation does *not* mean you have to write an entire audio CD all at once; see section (2-9) for an overview of track-at-once writing.

What happens when you try to play one of these as audio in your CDROM drive? As with most things multisession, it depends on your drive. (The control panel that comes with the Plextor 8Plex does the right thing. If you're using a different drive, you're on your own.)

Note that mixing MODE-1 (CDROM) and MODE-2 (CDROM-XA) sessions on a single disc isn't allowed. You could create such a thing, but CDROM drives would have a hard time recognizing it.

See also http://www.adaptec.com/support/cdrec/multisession.html, which goes into more depth.

Subject: [2-6] What are subcode channels?

There are eight subcode channels (P,Q,R,S,T,U,V,W). The exact method of encoding is beyond the scope of this FAQ, but it should be noted that the data is distributed uniformly across the entire CD, and each channel can hold a total of about 4MB.

The P subcode channel can be controlled with the JVC/Pinnacle recorders, but apparently isn't used for much.

The Q subcode channel includes useful information, which can be read and written on many recorders. The user data area contains three types of subcode-Q data: position information, media catalog number, and ISRC code. Other forms are found in the lead-in, and are used to enable multisession and describe the TOC (table of contents).

The position information is used by audio CD players to display the current time, and has track/index information. This can be controlled when doing Disc-At-Once recording.

The ISRC (International Standard Recording Code) is used by the recording industry. It states the country of origin, owner, year of issue, and serial number of tracks, and may be different for each track. It's optional; many CDs don't use this. The media catalog number is similar, but is constant per disc. Note these are different from the UPC codes.

The R-W subcode channels are used for text and graphics in certain applications, such as CD+G (CD w/graphics, supported by SegaCD among others). A new use has been devised by Philips, called ITTS. It enables properly equipped players to display text and graphics on Red Book audio discs. The most recent result of this technology is "CD-Text", which provides a way to embed disc and track data on a standard audio CD.

The other subcode channels are generally inaccessible and unused.

For more details, see the book by Pohlmann mentioned in section (2-1); Principles of DigitalAudio, 3rd edition, by Ken Pohlmann, McGraw-Hill, 1995 (ISBN 0-07-050469-5); or The Art of Digital Audio, 2nd edition, by John Watkinson, Focal Press, 1994 (ISBN 0-240-51320-7).

Subject: [2-7] Are the CD Identifier fields widely used?

At present, not many manufacturers use them, and not all devices can read all of the fields.

Subject: [2-8] How long does it take to burn a CD-R?

It depends on how much data you're going to burn, and how fast your drive is. Burning 650MB of data takes about 74 minutes at 1x, 37 minutes at 2x, and 19 minutes at 4x, but you have to add a minute or two for "finalizing" the disc. Remember that single speed is 150KB/sec, double speed is 300KB/sec, and so on.

If you have half the data, it will finish in (about) half the time.

Subject: [2-9] What's the difference between disc-at-once and track-at-once?

There are two basic ways of writing to a CD-R. Disc-at-once writes the entire CD in one pass, possibly writing multiple tracks. The entire burn must complete without interruption, and no further information may be added.

Track-at-once allows the writes to be done in multiple passes. There is a minimum track length of 300 blocks (600K for typical data CDs), and a maximum of 99 tracks per disc, as well as a slight additional overhead associated with stopping and restarting the laser.

With some software, track-at-once recording leaves run-in and run-out blocks between tracks, resulting in slight but annoying clicks between tracks. Astarte, the publishers of "Toast", have asserted that clicks between tracks are caused by bugs in the CD-R drive firmware or in the software used to write the discs, and that they can be avoided. (The difference may be that, so long as you don't stop writing between tracks, it's not necessary to write the run-in and run-out blocks. No extra blocks, no extra clicks.) Some drives and/or software packages may not let you control the size of the gap between audio tracks when recording in track-at-once mode, leaving you with 2-second gaps even if the original didn't have them.

A few recorders, such as the Philips CDD2000, allow "session-at-once" recording. This gives you disc-at-once control over the gaps between tracks, and allows you to write in more than one session. This can be handy when writing CD Extra discs (see section (3-14)).

There are some cases where disc-at-once recording is required. For example, it may not be possible to make backup copies of some kinds of discs without using disc-at-once mode (e.g. PSX games or copy-protected PC games). Also, some CD mastering plants may not accept discs recorded in track-at-once mode, because the gaps between tracks show up as errors.

The bottom line is that disc-at-once recording gives you more control over disc creation, especially for audio CDs, but isn't always appropriate or necessary. It's a good idea to get a recorder that supports both disc-at-once and track-at-once recording.

Subject: [2-10] Differences between recording from an image and on-the-fly?

Many CD-R creation packages will give you a choice between creating a complete image of the CD on disk and doing what's called "on-the-fly" writing. Each method has its advantages.

Disc image files are sometimes called virtual CDs or VCDs (not to be confused with VideoCD). These are complete copies of the data as it will appear on the CD, and so require that you have enough hard drive space to hold the complete CD. This could be as much as 650MB for CD-ROM or 747MB for an audio disc when using 74-minute blanks. If you have both audio and data tracks on your CD, there would be an ISO-9660 filesystem image for the data track and one or more 16-bit 44.1KHz stereo sound images for the audio tracks.

On-the-fly recording often uses a "virtual image", in which the complete set of files is examined and laid out, but only the file characteristics are stored, not the data. The contents of the files are read while the CD is being written. This method requires less available hard drive space and may save time, but increases the risk of buffer underruns (see section (4-1)). With most software this also gives greater flexibility, since it's easier to add, remove, and shuffle files in a virtual image than a physical one.

A CD created from an image file would be identical to one created with on-the-fly recording, assuming that both would put the same files in the same places. The choice of which to use depends on user preference and hardware capability.

Subject: [2-11] How does an audio CD player know to skip data tracks?

There are subcode flags for each track:
Data
If set, the track contains data; if not, the track contains audio.
Digital Copy Permitted
If set, copying is permitted
Four-Channel Audio
The Red Book standard allows four-channel audio, though very few discs have ever been made that use it.
Pre-Emphasis
Set if the audio was recorded with pre-emphasis.
The last three are rarely used.

Subject: [2-12] How does CD-E/CD-RW compare to CD-R?

CD-RW is short for CD-Rewritable. It used to be called CD-Erasable (CD-E), but some marketing folks changed it so it wouldn't sound like your important data gets erased on a whim. The difference between CD-RW and CD-R is that CD-RW discs can be erased and rewritten, while CD-R discs are write-once.

CD-RW drives use phase-change technology. Instead of creating "bubbles" and deformations in the recording dye layer, the state of material on the disc changes from crystalline to amorphous form. These discs are not writable by current CD-R drives, nor readable by many existing CD readers (the reflectivity of CD-RW is far below silver CDs and CD-R, so an Automatic Gain Control circuit is needed). Drives that can write both CD-R and CD-RW formats are now shipping, and most new CDROM drives are expected to support CD-RW. (Reports have indicated that CD-RW discs don't always read at full speed on some drives, however.)

CD-RW discs use the CD-UDF write-once filesystem, which means they won't be readable under some operating systems even if the hardware is compatible. Oddly enough, it may be easier for a DVD drive to read CD-RW discs than CD-R discs, because of the way the media is constructed.

All known CD-RW drives can write CD-R discs as well.

The first batch of CD-RW is much more expensive than CD-R. This is expected to change as sales volumes increase. There is a limit to the number of times an area of the disc can be rewritten, but that number is relatively high (somewhere between 1000 and 100,000).

For an *excellent* description of the techology, see http://www.onlineinc.com/cdrompro/0996CP/bennett9.html.

Some interesting articles on CD-RW - including an editorial critical of the new technology - can be found at:

Subject: [2-13] Can DVD drives read CD-Rs?

The only discs that a DVD drive is guaranteed to read are DVD discs. Support for CD-ROM, CD-R, and CD-RW may be included, but is by no means guaranteed.

CD-R was designed to be read by an infrared 780nm laser. DVD uses a visible red 635nm or 650nm laser, which aren't reflected sufficiently by the organic dye polymers used in CD-R media. Some DVD drives will come with two lasers so that they can read CD-R.

Some DVD drives may be unable to read multisession discs. If the box doesn't say that something is supported, assume that the feature isn't.

The MultiRead logo indicates that a CD or DVD player can read all existing CD formats, including CD-ROM, CD-DA, CD-R and CD-RW. See the press release at http://www.osta.org/osta/html/press/pr150797.html.

Subject: [2-14] Should I wait for DVD-R?

No. The writers are still very expensive and not widely available through consumer channels. DVD readers for video and for computers are shipping, but it will be some time before DVD-R is available to consumers.

Subject: [2-15] What are "jitter" and "jitter correction"?

Jitter is a complex concept that appears in several different areas. In the context of digital audio extraction from CD-DA discs, jitter causes extracted audio samples to be doubled-up or skipped entirely. Jitter correction is the process of restoring the audio data to its intended form.

The problem occurs because the Philips CD specification doesn't require block-accurate addressing. While the audio data is being fed into a buffer (a FIFO whose high- and low-water marks control the spindle speed), the address information for audio blocks is pulled out of the subcode channel and fed into a different part of the controller. Because the data and address information are disconnected, the CD player is unable to identify the exact start of a frame. This mismatch will span less than 1/75th of a second, but if it happens several times it will be noticeable as clicks and pops.

On a CD-ROM, the blocks have a 12-byte sync pattern in the header, as well as a copy of the block's address. It's possible to identify the start of a block and get the block's address by watching the FIFO alone.

With most CD-ROM drives that support digital audio extraction, you can get jitter-free audio by using a program that extracts the entire track all at once. The problem with this method is that if the hard drive being written to can't keep up, some of the samples will be dropped. (This is similar to a CD-R buffer underrun, but since the output buffer used during DAE is much smaller than a CD-R's input buffer, the problem is magnified.)

Some CD-ROM drives, such as most of the Plextor models, include special circuitry that enables them to accurately detect the start of a block.

An approach that has produced good results is to do jitter correction in software. This involves performing overlapping reads, and then sliding the data around to find overlaps at the edges. Most DAE programs will perform jitter correction.

Subject: [2-16] Where can I learn more about the history of CD and CD-R?

I don't have a favorite book or web site to recommend. Poke around on the http://www.cd-info.com/ web site, especially some of the books and links listed in the bibliography.

top of page


FAQ Index | Previous Section | Next Section

Home | Applications | Bibliography | CD-Lite
History | Industry | Sponsors | Technology

FAQ Copyright 1997 Andy McFadden
HTML Copyright 1997 The CD-Info Company, Inc.

970819